package walk;

import java.util.concurrent.atomic.AtomicInteger;

import org.jsoup.Connection;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;

import comm.LOG;

public class cy extends Thread {

	private static AtomicInteger ai = new AtomicInteger(2014953445);

	private static LOG log = new LOG("C:\\csuu\\cywalk.offset");

	public void run() {

		while (true) {
			int i = ai.getAndDecrement();

			if (i % 100 == 0) {
				log.info(i);
			}

			String url = "http://cyworld.ifensi.com/ps2/index.php?mh_id="+i;
			try {
				Connection c = Jsoup.connect(url);

				c.userAgent("Mozilla/5.0 (Windows NT 6.2; WOW64; rv:18.0) Gecko/20100101 Firefox/18.0");
				c.header("Cookie", "");

				c.referrer("http://cyworld.ifensi.com/");
				c.get();

				System.out.println(i);
				//sleep(300);

			} catch (Exception e) {
				System.out.println(e.getMessage());
			}
		}

	}

	public static void main(String[] args) {
		for (int i = 0; i < 1; i++) {
			new cy().start();
		}
	}
}
